package la.iok.hzsvn.lewin.movie.entity;

import java.util.Date;
import java.util.Objects;

/**
 * 剧本实例,每次发布的时候，产生一个实例
 */
public class MovieInstance extends Movie {
    /**
     * 发布的剧本id
     */
    private Long movieId;
    /**
     * 发布时间
     */
    private Date publishTime;

    /**
     * 剧本手册文件路径。html文档
     */
    private String assistHtml;
    /**
     * 剧本手册文件id。html文档
     */
    private Long assistHtmlFileId;
    /**
     * 标记剧本文件是否已经删除。删除剧本实例的剧本文件,对剧本引用的所有文件引用计数减1，并将引用剧本文件的每个子表对象都标记为文件已经删除。
     * 0：默认值，未删除；1：已删除
     */
    private Integer fileDeleted;

    public Long getMovieId() {
        return movieId;
    }

    public void setMovieId(Long movieId) {
        this.movieId = movieId;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public String getAssistHtml() {
        return assistHtml;
    }

    public void setAssistHtml(String assistHtml) {
        this.assistHtml = assistHtml;
    }

    public Long getAssistHtmlFileId() {
        return assistHtmlFileId;
    }

    public void setAssistHtmlFileId(Long assistHtmlFileId) {
        this.assistHtmlFileId = assistHtmlFileId;
    }

    public Integer getFileDeleted() {
        return fileDeleted;
    }

    public void setFileDeleted(Integer fileDeleted) {
        this.fileDeleted = fileDeleted;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        MovieInstance that = (MovieInstance) o;
        return Objects.equals(movieId, that.movieId) && Objects.equals(publishTime, that.publishTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), movieId, publishTime);
    }
}
